deltas: Only keep one file open at a time during compilation
authorColin Walters <walters@verbum.org>
Thu, 3 Nov 2016 12:32:19 +0000 (08:32 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 7 Nov 2016 11:17:59 +0000 (11:17 +0000)
commit24ac4ff190a96de47fab73d81c257f089c0e2020
tree1ca4a58721b3a04a8ea9b849ab8e8d4b93642abd
parent2b150f52f8961b9e7b3a477d59b68275902ed1a7
deltas: Only keep one file open at a time during compilation

Otherwise it's possible for us to exhaust available file descriptors
or (on 32 bit) run up against mmap limits.

In the rollsum case, we didn't need to hold open the "from" object
at all.  And in the bsdiff case, we weren't even looking at either of
the files until we started processing.

Also, while we have the patient open, switch to using O_TMPFILE
if available.

Closes: #567
Approved by: giuseppe
src/libostree/ostree-repo-static-delta-compilation.c